<template>
  <div>
    <img
      :src="userQrCode"
      style="width: 100%;height: 100%"
    >
  </div>
</template>

<script>
import {
  getCompanyId
} from '@/util/storage'
import {
  getLoginQrcode
} from '@/api/iot/iotTokenApi'
export default {
  name: 'LoginQrcode',
  data() {
    return {
      userQrCode: null
    }
  }, mounted() {
    this.getLoginQrcode()
  }, methods: {
    getLoginQrcode() {
      getLoginQrcode({
        companyId: getCompanyId()
      }).then(res => {
        const { code, data } = res
        if (code === '200') {
          this.userQrCode = data
          this.$emit('change', data)
        }
      })
    }
  }
}
</script>


